package com.hexacta.hrs.domain.feedback;

import com.hexacta.hrs.domain.feedback.effort.EffortScoreType;

public class FeedbacksDataSummary {

	private Long effortCountSobresaliente;
    private Long effortCountBueno;
    private Long effortCountRegular;
    
    private Long scoreCountNAE;
    private Long scoreCountADE;
    private Long scoreCountAE;
    private Long scoreCountAEE;
    private Long scoreCountEE;
    
    public Long getEffortCountSobresaliente() {
		return effortCountSobresaliente;
	}

	public void setEffortCountSobresaliente(Long effortCountSobresaliente) {
		this.effortCountSobresaliente = effortCountSobresaliente;
	}

	public Long getEffortCountBueno() {
		return effortCountBueno;
	}

	public void setEffortCountBueno(Long effortCountBueno) {
		this.effortCountBueno = effortCountBueno;
	}

	public Long getEffortCountRegular() {
		return effortCountRegular;
	}

	public void setEffortCountRegular(Long effortCountRegular) {
		this.effortCountRegular = effortCountRegular;
	}

	public Long getScoreCountNAE() {
		return scoreCountNAE;
	}

	public void setScoreCountNAE(Long scoreCountNAE) {
		this.scoreCountNAE = scoreCountNAE;
	}

	public Long getScoreCountADE() {
		return scoreCountADE;
	}

	public void setScoreCountADE(Long scoreCountADE) {
		this.scoreCountADE = scoreCountADE;
	}

	public Long getScoreCountAE() {
		return scoreCountAE;
	}

	public void setScoreCountAE(Long scoreCountAE) {
		this.scoreCountAE = scoreCountAE;
	}

	public Long getScoreCountAEE() {
		return scoreCountAEE;
	}

	public void setScoreCountAEE(Long scoreCountAEE) {
		this.scoreCountAEE = scoreCountAEE;
	}

	public Long getScoreCountEE() {
		return scoreCountEE;
	}

	public void setScoreCountEE(Long scoreCountEE) {
		this.scoreCountEE = scoreCountEE;
	}

	public long acumulatedScoreCount() {
		return scoreCountNAE + scoreCountADE + scoreCountAE + scoreCountAEE + scoreCountEE;
	}
	
	public String getHrsFinalScore() {
		if ((scoreCountNAE > 0) && 
				((acumulatedScoreCount() - scoreCountNAE) == 0)) {
			return ScoreType.NAE.getDescription();
		}
		
		if ((scoreCountADE > 0) && 
				((acumulatedScoreCount() - scoreCountADE) == 0)) {
			return ScoreType.ADE.getDescription();
		}
		
		if ((scoreCountAE > 0) && 
				((acumulatedScoreCount() - scoreCountAE) == 0)) {
			return ScoreType.AE.getDescription();
		}
		
		if ((scoreCountAEE > 0) && 
				((acumulatedScoreCount() - scoreCountAEE) == 0)) {
			return ScoreType.AEE.getDescription();
		}
		
		if ((scoreCountEE > 0) && 
				((acumulatedScoreCount() - scoreCountEE) == 0)) {
			return ScoreType.EE.getDescription();
		}
		
		return "-";
	}
	
	public String getHrsFinalEffort() {
		if ((effortCountSobresaliente > 0) && 
				((effortCountBueno + effortCountRegular) == 0)) {
			return EffortScoreType.Sobresaliente.name();
		}
		
		if ((effortCountBueno > 0) && 
				((effortCountSobresaliente + effortCountRegular) == 0)) {
			return EffortScoreType.Bueno.name();
		}
		
		if ((effortCountRegular > 0) && 
				((effortCountSobresaliente + effortCountBueno) == 0)) {
			return EffortScoreType.Regular.name();
		}
		
		return "-";
	}
	
}
